package controller;

import hci.ChatGui;

import java.io.File;

import observerNotification.ChangingStateObserverNotification;
import observerNotification.ErrorObserverNotification;
import observerNotification.ObserverNotification;


/**
 * Sets specific control methods for the <b>disconnected</b> state.
 * 
 * <p>
 * <ul>
 * <li>Project: 	ChatSystemG3</li>
 * <li>Called by: 	controller.*</li>
 * </ul>
 * </p>
 * 
 * @author COMBES Nicolas - LECHANTRE Arnaud
 * @see State
 */
public class DisconnectedState extends State{

	@Override
	public ObserverNotification performConnect(String text) {
		if(text.length()<4){
			return new ErrorObserverNotification(ChatGui.strings.getString("errorUsernameToShortText"));
		}
		
		return new ChangingStateObserverNotification (text, ChangingStateObserverNotification.EnumState.CONNECTED);
	}
	
	@Override
	public Boolean sendFile(File file) {
		return false;
	}  
}
